package cn.funnyxb.powerremember.uis.task.done.autobrow;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.RotateAnimation;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import cn.funnyxb.powerremember.ad.ADController;
import cn.funnyxb.powerremember.beans.AWord;
import cn.funnyxb.powerremember.pullMsg.beans.AppConfig;
import cn.funnyxb.powerremember.uis.task.done.InputIntentChecker;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.ActivitysHolder;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;
import com.adview.AdViewInterface;
import com.adview.AdViewLayout;
import com.mobclick.android.MobclickAgent;
import com.mt.airad.AirAD;
import com.mt.airad.AirAD.AdListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.StringTokenizer;

public class AutoBrowActivity extends Activity
  implements IUI_AutoBrow
{
  private static final int ContextMenuId_AGAIN_ASC = 1;
  private static final int ContextMenuId_AGAIN_DESC = 2;
  private static final int ContextMenuId_HAND2FIRST = 3;
  private static final int ContextMenuId_RETURN = 4;
  private static final int DIALOGID_HELP = 50;
  private static final int DIALOGID_MODESET_AUTOPLAY = 30;
  private static final int DIALOGID_MODESET_HANDPLAY = 20;
  private static final int DIALOGID_SELECT = 40;
  private static final int OptionMenuItemId_autoset = 20;
  private static final int OptionMenuItemId_handset = 10;
  private static final int OptionMenuItemId_help = 40;
  private static final int OptionMenuItemId_select = 30;
  private AirAD ad = null;
  ADController adController = App.getApp().getADController();
  int adid = 0;
  private Dialog autoBrowSetDialog;
  private View.OnClickListener btnsOnClickListener = new View.OnClickListener()
  {
    public void onClick(View paramView)
    {
      switch (paramView.getId())
      {
      case 2131165216:
      case 2131165217:
      case 2131165218:
      case 2131165219:
      case 2131165220:
      case 2131165226:
      case 2131165227:
      default:
      case 2131165229:
      case 2131165228:
      case 2131165225:
      case 2131165224:
      case 2131165223:
      case 2131165222:
      case 2131165221:
      case 2131165215:
      }
      while (true)
      {
        return;
        AutoBrowActivity.this.adjustDifficulty(1);
        continue;
        AutoBrowActivity.this.adjustDifficulty(-1);
        continue;
        AutoBrowActivity.this.next();
        continue;
        AutoBrowActivity.this.pause();
        continue;
        AutoBrowActivity.this.play();
        continue;
        AutoBrowActivity.this.pre();
        continue;
        AutoBrowActivity.this.search();
        continue;
        AutoBrowActivity.this.proccessor.requestSpeechWord(AutoBrowActivity.this.currentWord.getWord());
      }
    }
  };
  private AutoBrowConfiger config;
  private ContentController contentController;
  private AWord currentWord;
  private long endTime;
  int lastClickAdid = -1;
  private IProccessor_AutoBrow proccessor;
  private ProgressDialog progressDialog;
  private SentenceCache sentenceCache = new SentenceCache(null);
  private long startTime;
  private String windowTitle;

  static
  {
    AirAD.setGlobalParameter("16fc216e-6650-4c8b-ab35-2228df9f5e67", 10.0D);
  }

  private void adjustDifficulty(int paramInt)
  {
    int i = paramInt + this.currentWord.getDifficulty();
    if (i > 9)
      Toast.makeText(this, 2131034325, 0).show();
    while (true)
    {
      return;
      if (i < 0)
        Toast.makeText(this, 2131034324, 0).show();
      this.currentWord.setDifficulty(i);
      setDifficultyOnUi(i);
      this.proccessor.updateDifficulty(this.currentWord.getId(), i);
    }
  }

  private void checkView4ShowSentence()
  {
    log("show sentence--checkView4ShowSentence");
    View localView1 = findViewById(2131165233);
    if (localView1.getVisibility() != 8)
      return;
    View localView2 = findViewById(2131165231);
    ViewGroup.LayoutParams localLayoutParams = localView2.getLayoutParams();
    localLayoutParams.height = -2;
    localView2.setLayoutParams(localLayoutParams);
    localView1.setVisibility(0);
  }

  private void clearView()
  {
    ((TextView)findViewById(2131165216)).setText("");
    ((TextView)findViewById(2131165217)).setText("");
    ((TextView)findViewById(2131165232)).setText("");
    ((TextView)findViewById(2131165235)).setText(2131034319);
    showAnim();
    this.sentenceCache.clear();
    updateView4HandPlayConfig();
  }

  private void dismissWaittingDialog()
  {
    if (this.progressDialog == null)
      return;
    this.progressDialog.dismiss();
  }

  private void hideAD_adView()
  {
    findViewById(2131165213).setVisibility(8);
  }

  private void hideAnim()
  {
    View localView = findViewById(2131165236);
    localView.clearAnimation();
    localView.setVisibility(8);
    findViewById(2131165237).setVisibility(8);
  }

  private void initBtnsClickListener()
  {
    findViewById(2131165223).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165224).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165222).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165225).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165221).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165229).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165228).setOnClickListener(this.btnsOnClickListener);
    findViewById(2131165215).setOnClickListener(this.btnsOnClickListener);
  }

  private void initFrame()
  {
    ((TextView)findViewById(2131165217)).setTypeface(App.getApp().getMyTypeface());
    initBtnsClickListener();
    initTouchListener();
  }

  private void initTouchListener()
  {
    findViewById(2131165230).setOnTouchListener(new DifficultyTouchListener(new DifficultyTouchListener.SimpleTouchListener()
    {
      public void onFilingDown()
      {
        AutoBrowActivity.this.adjustDifficulty(-1);
      }

      public void onFilingUp()
      {
        AutoBrowActivity.this.adjustDifficulty(1);
      }
    }));
  }

  private void log(String paramString)
  {
    Debuger.log("autobrow", paramString);
  }

  private void next()
  {
    this.proccessor.getNext();
  }

  private String parseOnlineSentence(ArrayList<String> paramArrayList)
  {
    if (paramArrayList == null);
    String str1;
    int i;
    int j;
    Iterator localIterator;
    for (Object localObject = null; ; localObject = str1)
    {
      return localObject;
      str1 = "";
      i = 0;
      j = 0;
      localIterator = paramArrayList.iterator();
      if (localIterator.hasNext())
        break;
      if (i >= 2)
        continue;
      str1 = getString(2131034320);
    }
    String str2 = (String)localIterator.next();
    StringBuilder localStringBuilder = new StringBuilder(String.valueOf(str1));
    String str3 = (++j) + "、";
    StringTokenizer localStringTokenizer = new StringTokenizer(str2, "|");
    while (true)
    {
      if (!(localStringTokenizer.hasMoreElements()))
        str1 = str3 + "\n";
      str3 = str3 + localStringTokenizer.nextToken() + "\n";
      ++i;
    }
  }

  private void pause()
  {
    pauseOnUI();
    Toast.makeText(App.getApp(), 2131034322, 0).show();
    this.proccessor.pause();
  }

  private void pauseOnUI()
  {
    findViewById(2131165224).setVisibility(8);
    findViewById(2131165223).setVisibility(0);
    updateDirectionPlayBtn();
  }

  private void play()
  {
    playOnUI();
    Toast.makeText(App.getApp(), 2131034323, 0).show();
    this.proccessor.play();
  }

  private void playOnUI()
  {
    findViewById(2131165224).setVisibility(0);
    findViewById(2131165223).setVisibility(8);
    findViewById(2131165222).setEnabled(false);
    findViewById(2131165225).setEnabled(false);
  }

  private void pre()
  {
    this.proccessor.getPre();
  }

  private void prepareAD()
  {
    log("prepareAD,isCloseAd=" + this.adController.isCloseAd(this));
    if (!(App.getApp().getAppConfig().isAdFunction()));
    while (true)
    {
      return;
      AppConfig localAppConfig = App.getApp().getAppConfig();
      if (localAppConfig.isAdFunction_autobrow_adview())
        prepareAdView();
      if ((this.adController.isCloseAd(this)) || (!(localAppConfig.isAdFunction_autobrow_airad())))
        continue;
      prepareAirad();
    }
  }

  private void prepareAdView()
  {
    LinearLayout localLinearLayout = (LinearLayout)findViewById(2131165214);
    if (localLinearLayout == null);
    while (true)
    {
      return;
      AdViewLayout localAdViewLayout = new AdViewLayout(this, "SDK20112317530746gbtoshlnjwggb48");
      localLinearLayout.addView(localAdViewLayout, new RelativeLayout.LayoutParams(-1, -2));
      localLinearLayout.invalidate();
      localAdViewLayout.setAdViewInterface(new AdViewInterface()
      {
        public void onClickAd()
        {
          AutoBrowActivity.this.log("adview onclicked");
          if (AutoBrowActivity.this.adController.isCloseAd(AutoBrowActivity.this))
            AutoBrowActivity.this.hideAD_adView();
          while (true)
          {
            return;
            AutoBrowActivity.this.showAD_adView();
            if (AutoBrowActivity.this.adid == AutoBrowActivity.this.lastClickAdid)
              continue;
            AutoBrowActivity.this.lastClickAdid = AutoBrowActivity.this.adid;
            AutoBrowActivity.this.adController.notifyAdClick();
          }
        }

        public void onDisplayAd()
        {
          AutoBrowActivity.this.log("adview onDisplay");
          if (AutoBrowActivity.this.adController.isCloseAd(AutoBrowActivity.this))
            AutoBrowActivity.this.hideAD_adView();
          while (true)
          {
            return;
            AutoBrowActivity.this.log("adview show");
            AutoBrowActivity.this.showAD_adView();
            AutoBrowActivity localAutoBrowActivity = AutoBrowActivity.this;
            localAutoBrowActivity.adid = (1 + localAutoBrowActivity.adid);
            AutoBrowActivity.this.adController.notifyAdTrueShow();
          }
        }
      });
    }
  }

  private void prepareAirad()
  {
    log("prepare airad");
    this.ad = new AirAD(this, 12, 1);
    this.ad.setAdListener(new AirAD.AdListener()
    {
      public void onAdBannerClicked()
      {
        AutoBrowActivity.this.log("airad clicked");
        if (AutoBrowActivity.this.adController.isCloseAd(AutoBrowActivity.this))
        {
          AutoBrowActivity.this.log("complete,closead");
          AutoBrowActivity.this.ad.destory();
          AutoBrowActivity.this.ad = null;
        }
        while (true)
        {
          return;
          AutoBrowActivity.this.adController.notifyAdClick();
        }
      }

      public void onAdBannerReceive()
      {
        AutoBrowActivity.this.log("airad receive");
        if (AutoBrowActivity.this.adController.isCloseAd(AutoBrowActivity.this))
        {
          AutoBrowActivity.this.log("complete,closead");
          AutoBrowActivity.this.ad.destory();
          AutoBrowActivity.this.ad = null;
        }
        while (true)
        {
          return;
          AutoBrowActivity.this.adController.notifyAdTrueShow();
        }
      }

      public void onAdBannerReceiveFailed()
      {
        AutoBrowActivity.this.log("airad receivefailed");
      }

      public void onMultiAdDismiss()
      {
        AutoBrowActivity.this.log("airad onMultiadDismiss");
      }
    });
  }

  private void search()
  {
    if (this.currentWord == null)
      return;
    this.proccessor.querrySentence(this.currentWord.getId(), this.currentWord.getWord());
  }

  private void setDifficultyOnUi(int paramInt)
  {
    ((RatingBar)findViewById(2131165219)).setRating(paramInt);
    ((TextView)findViewById(2131165218)).setText(paramInt);
  }

  private void showAD_adView()
  {
    findViewById(2131165213).setVisibility(0);
  }

  private void showAnim()
  {
    findViewById(2131165237).setVisibility(0);
    View localView = findViewById(2131165236);
    localView.setVisibility(0);
    RotateAnimation localRotateAnimation = new RotateAnimation(0.0F, 360.0F, 24.0F, 24.0F);
    localRotateAnimation.setRepeatCount(-1);
    localRotateAnimation.setDuration(2000L);
    localView.startAnimation(localRotateAnimation);
  }

  private void showOnlineSentence(String paramString)
  {
    log("show sentence");
    hideAnim();
    ((TextView)findViewById(2131165235)).setText(getString(2131034321) + "：\n" + paramString);
    ((ScrollView)findViewById(2131165234)).scrollTo(0, 0);
  }

  private void showPlayMenu()
  {
    View localView = findViewById(2131165212);
    registerForContextMenu(localView);
    openContextMenu(localView);
  }

  private void showWaittingDialog()
  {
    this.progressDialog = new ProgressDialog(this);
    this.progressDialog.setMessage(getString(2131034132));
    this.progressDialog.show();
  }

  private void updateDirectionPlayBtn()
  {
    if (this.proccessor.getState() == 2)
    {
      findViewById(2131165222).setEnabled(false);
      findViewById(2131165225).setEnabled(false);
    }
    while (true)
    {
      return;
      boolean bool1 = this.contentController.hasNext();
      boolean bool2 = this.contentController.hasPre();
      findViewById(2131165222).setEnabled(bool2);
      findViewById(2131165225).setEnabled(bool1);
    }
  }

  private void updateView4HandPlayConfig()
  {
    if (this.config == null);
    while (true)
    {
      label7: return;
      if (this.proccessor.getState() == 2);
      for (boolean bool = this.config.getTaskQueneCopy().isExistShowSentenceTaskWhenAutoBrow(); bool; bool = this.config.isAutoQueryOnline())
      {
        View localView2 = findViewById(2131165231);
        ViewGroup.LayoutParams localLayoutParams2 = localView2.getLayoutParams();
        localLayoutParams2.height = -2;
        localView2.setLayoutParams(localLayoutParams2);
        findViewById(2131165233).setVisibility(0);
        findViewById(2131165221).setVisibility(8);
        break label7:
      }
      View localView1 = findViewById(2131165231);
      ViewGroup.LayoutParams localLayoutParams1 = localView1.getLayoutParams();
      localLayoutParams1.height = -1;
      localView1.setLayoutParams(localLayoutParams1);
      findViewById(2131165233).setVisibility(8);
      findViewById(2131165221).setVisibility(0);
    }
  }

  public void notifyAutoPlayCompleted()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      pauseOnUI();
      showPlayMenu();
    }
  }

  public void notifyAutoPlayInterruptted()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      updateDirectionPlayBtn();
    }
  }

  public void notifyClearView()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      clearView();
    }
  }

  public void notifyConfig(AutoBrowConfiger paramAutoBrowConfiger)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      this.config = paramAutoBrowConfiger;
      updateView4HandPlayConfig();
    }
  }

  public void notifyErrCall()
  {
    Toast.makeText(this, 2131034147, 1).show();
    finish();
  }

  public void notifyGetNextFailed()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      Toast.makeText(this, 2131034330, 0).show();
    }
  }

  public void notifyGetPreFailed()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      Toast.makeText(this, 2131034330, 0).show();
    }
  }

  public void notifyIntentOk(InputIntentChecker paramInputIntentChecker)
  {
    if ((isFinishing()) || (isRestricted()))
      label14: return;
    Toast.makeText(this, 2131034318, 1).show();
    switch (paramInputIntentChecker.getRangeType())
    {
    default:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      this.windowTitle = getString(2131034112) + " - " + this.windowTitle;
      setTitle(this.windowTitle);
      break label14:
      this.windowTitle = getString(2131034160) + paramInputIntentChecker.getGroupId() + getString(2131034149);
      continue;
      this.windowTitle = getString(2131034160) + paramInputIntentChecker.getGroupStart() + " -- " + paramInputIntentChecker.getGroupEnd() + getString(2131034149);
      continue;
      this.windowTitle = getString(2131034160) + paramInputIntentChecker.getWordStart() + " -- " + paramInputIntentChecker.getWordEnd() + getString(2131034150);
    }
  }

  public void notifyNoWordSuit()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      new AlertDialog.Builder(this).setTitle(2131034130).setCancelable(false).setMessage(2131034338).setNegativeButton(2131034133, new DialogInterface.OnClickListener()
      {
        public void onClick(DialogInterface paramDialogInterface, int paramInt)
        {
          AutoBrowActivity.this.showDialog(40);
        }
      }).show();
    }
  }

  public void notifyPrepareWorkCompleted()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      dismissWaittingDialog();
      this.contentController = ContentController.getControler();
    }
  }

  public void notifySentencesLoaded(int paramInt, ArrayList<String> paramArrayList)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      String str = parseOnlineSentence(paramArrayList);
      this.sentenceCache.sentenceStr = str;
      this.sentenceCache.sentence4wordId = paramInt;
      if ((!(this.sentenceCache.isNotifyed2Show)) || (this.sentenceCache.sentence4wordId != this.currentWord.getId()))
        continue;
      showOnlineSentence(str);
    }
  }

  public void notifyShowMeaning(String paramString)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      ((TextView)findViewById(2131165232)).setText(paramString);
    }
  }

  public void notifyShowPhonetic(String paramString)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      ((TextView)findViewById(2131165217)).setText(paramString);
    }
  }

  public void notifyShowSentences()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      checkView4ShowSentence();
      this.sentenceCache.isNotifyed2Show = true;
      if ((this.sentenceCache.sentenceStr == null) || (this.sentenceCache.sentence4wordId != this.currentWord.getId()))
        continue;
      showOnlineSentence(this.sentenceCache.sentenceStr);
    }
  }

  public void notifyShowWord(String paramString)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      log("showword=" + paramString);
      ((TextView)findViewById(2131165216)).setText(paramString);
    }
  }

  public void notifyWaitingLoadData()
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      showWaittingDialog();
    }
  }

  public void notifyWordInfo(AWord paramAWord)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      if (paramAWord == null)
        continue;
      this.currentWord = paramAWord;
      clearView();
      setDifficultyOnUi(paramAWord.getDifficulty());
      setTitle(this.windowTitle + "(" + this.contentController.getCurrentIndexOfThisUnit() + "/" + this.contentController.getCountOfThisUnit() + ")");
      updateDirectionPlayBtn();
    }
  }

  public boolean onContextItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      return super.onContextItemSelected(paramMenuItem);
      this.contentController.changeAutoBrowDirection(false);
      this.contentController.reset2Head();
      playOnUI();
      this.proccessor.play();
      continue;
      this.contentController.reset2Tail();
      this.contentController.changeAutoBrowDirection(true);
      playOnUI();
      this.proccessor.play();
      continue;
      this.contentController.changeAutoBrowDirection(false);
      this.proccessor.getFirst();
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903045);
    clearView();
    this.proccessor = new Proccessor_AutoBrow(this);
    this.proccessor.asyncPrepare(getIntent());
    initFrame();
    prepareAD();
  }

  public void onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  {
    super.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
    paramContextMenu.setHeaderTitle(2131034329);
    paramContextMenu.add(0, 1, 1, 2131034326);
    paramContextMenu.add(0, 2, 2, 2131034327);
    paramContextMenu.add(0, 3, 3, 2131034328);
    paramContextMenu.add(0, 4, 4, 2131034134);
  }

  protected Dialog onCreateDialog(int paramInt)
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    switch (paramInt)
    {
    default:
    case 20:
    case 30:
    case 40:
    case 50:
    }
    for (Object localObject = null; ; localObject = localBuilder.create())
    {
      while (true)
      {
        return localObject;
        View localView3 = getLayoutInflater().inflate(2130903047, null);
        localBuilder.setTitle(2131034331);
        localBuilder.setView(localView3);
        localBuilder.setPositiveButton(2131034133, new DialogInterface.OnClickListener(localView3)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            boolean bool1 = ((CheckBox)this.val$view.findViewById(2131165244)).isChecked();
            boolean bool2 = ((CheckBox)this.val$view.findViewById(2131165245)).isChecked();
            if ((bool1) && (!(AutoBrowActivity.this.config.isAutoQueryOnline())))
              AutoBrowActivity.this.search();
            AutoBrowActivity.this.config.setAutoQueryOnline(bool1);
            AutoBrowActivity.this.config.setSpeechOnClickWhenHandmode(bool2);
            AutoBrowActivity.this.updateView4HandPlayConfig();
            String str = ((EditText)this.val$view.findViewById(2131165243)).getEditableText().toString();
            int i = -1;
            int j = 1;
            try
            {
              int k = Integer.parseInt(str);
              i = k;
              label127: if ((j != 0) && (i <= 10) && (i >= 0))
                break label166;
              Toast.makeText(AutoBrowActivity.this, 2131034335, 1).show();
              label166: return;
            }
            catch (Exception localException)
            {
              j = 0;
              break label127:
              AutoBrowActivity.this.config.setAutoSpeechTimesWhenHandmode(i);
            }
          }
        });
        localBuilder.setNegativeButton(2131034134, null);
        localObject = localBuilder.create();
        continue;
        View localView2 = getLayoutInflater().inflate(2130903046, null);
        EditText localEditText = (EditText)localView2.findViewById(2131165239);
        localEditText.addTextChangedListener(new TextWatcher(localView2)
        {
          public void afterTextChanged(Editable paramEditable)
          {
            boolean bool = true;
            if (!(paramEditable.toString().matches("[12345678]+")))
            {
              bool = false;
              Toast.makeText(AutoBrowActivity.this, 2131034336, 0).show();
            }
            if (AutoBrowActivity.this.autoBrowSetDialog != null)
              ((AlertDialog)AutoBrowActivity.this.autoBrowSetDialog).getButton(-1).setEnabled(bool);
            ScrollView localScrollView = (ScrollView)this.val$autoview.findViewById(2131165241);
            localScrollView.scrollTo(0, localScrollView.getHeight());
          }

          public void beforeTextChanged(CharSequence paramCharSequence, int paramInt1, int paramInt2, int paramInt3)
          {
          }

          public void onTextChanged(CharSequence paramCharSequence, int paramInt1, int paramInt2, int paramInt3)
          {
            AutoBrowActivity.this.log("s=" + paramCharSequence + ",start=" + paramInt1 + ",before=" + paramInt2 + ",count=" + paramInt3);
            ((TextView)this.val$autoview.findViewById(2131165242)).setText(AutoBrowActivity.this.config.translateActionStr(paramCharSequence.toString()));
          }
        });
        localBuilder.setTitle(2131034332);
        localBuilder.setView(localView2);
        localBuilder.setPositiveButton(2131034133, new DialogInterface.OnClickListener(localEditText)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            boolean bool = AutoBrowActivity.this.config.saveActions(this.val$et.getEditableText().toString().trim());
            AutoBrowActivity localAutoBrowActivity = AutoBrowActivity.this;
            if (bool);
            for (String str = AutoBrowActivity.this.getString(2131034163); ; str = AutoBrowActivity.this.getString(2131034164))
            {
              Toast.makeText(localAutoBrowActivity, str, 0).show();
              return;
            }
          }
        });
        localBuilder.setNegativeButton(2131034134, null);
        this.autoBrowSetDialog = localBuilder.create();
        localObject = this.autoBrowSetDialog;
        continue;
        View localView1 = getLayoutInflater().inflate(2130903050, null);
        ((CheckBox)localView1.findViewById(2131165261)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(localView1)
        {
          public void onCheckedChanged(CompoundButton paramCompoundButton, boolean paramBoolean)
          {
            View localView = this.val$vv.findViewById(2131165262);
            if (paramBoolean);
            for (int i = 0; ; i = 8)
            {
              localView.setVisibility(i);
              return;
            }
          }
        });
        localBuilder.setTitle(2131034316).setView(localView1).setPositiveButton(2131034133, new DialogInterface.OnClickListener(localView1)
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            boolean bool = ((CheckBox)this.val$vv.findViewById(2131165261)).isChecked();
            ArrayList localArrayList = new ArrayList();
            if (bool)
            {
              if (((CheckBox)this.val$vv.findViewById(2131165273)).isChecked())
                localArrayList.add(Integer.valueOf(0));
              if (((CheckBox)this.val$vv.findViewById(2131165264)).isChecked())
                localArrayList.add(Integer.valueOf(1));
              if (((CheckBox)this.val$vv.findViewById(2131165265)).isChecked())
                localArrayList.add(Integer.valueOf(2));
              if (((CheckBox)this.val$vv.findViewById(2131165266)).isChecked())
                localArrayList.add(Integer.valueOf(3));
              if (((CheckBox)this.val$vv.findViewById(2131165267)).isChecked())
                localArrayList.add(Integer.valueOf(4));
              if (((CheckBox)this.val$vv.findViewById(2131165268)).isChecked())
                localArrayList.add(Integer.valueOf(5));
              if (((CheckBox)this.val$vv.findViewById(2131165269)).isChecked())
                localArrayList.add(Integer.valueOf(6));
              if (((CheckBox)this.val$vv.findViewById(2131165270)).isChecked())
                localArrayList.add(Integer.valueOf(7));
              if (((CheckBox)this.val$vv.findViewById(2131165271)).isChecked())
                localArrayList.add(Integer.valueOf(8));
              if (((CheckBox)this.val$vv.findViewById(2131165272)).isChecked())
                localArrayList.add(Integer.valueOf(9));
            }
            AutoBrowActivity.this.proccessor.notifyDifficultySetChange(localArrayList);
          }
        }).setCancelable(false);
        localObject = localBuilder.create();
      }
      localBuilder.setTitle(2131034334);
      localBuilder.setMessage(2131034337);
      localBuilder.setNegativeButton(2131034158, null);
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    paramMenu.add(0, 10, 0, 2131034331);
    paramMenu.add(0, 20, 1, 2131034332);
    paramMenu.add(0, 30, 2, 2131034333);
    paramMenu.add(0, 40, 3, 2131034334);
    return super.onCreateOptionsMenu(paramMenu);
  }

  protected void onDestroy()
  {
    this.proccessor.destroy();
    super.onDestroy();
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 10:
    case 20:
    case 30:
    case 40:
    }
    while (true)
    {
      return super.onOptionsItemSelected(paramMenuItem);
      showDialog(20);
      continue;
      showDialog(30);
      continue;
      showDialog(40);
      continue;
      showDialog(50);
    }
  }

  protected void onPause()
  {
    super.onPause();
    MobclickAgent.onPause(this);
    this.endTime = System.currentTimeMillis();
    this.proccessor.notifyStudyLog(this.startTime, this.endTime);
  }

  protected void onPrepareDialog(int paramInt, Dialog paramDialog)
  {
    super.onPrepareDialog(paramInt, paramDialog);
    switch (paramInt)
    {
    default:
    case 20:
    case 30:
      while (true)
      {
        return;
        log("config=" + this.config);
        ((CheckBox)paramDialog.findViewById(2131165244)).setChecked(this.config.isAutoQueryOnline());
        ((CheckBox)paramDialog.findViewById(2131165245)).setChecked(this.config.isSpeechOnClickWhenHandMode());
        ((EditText)paramDialog.findViewById(2131165243)).setText(this.config.getAutoSpeechTimesWhenHandmode());
        continue;
        String str = this.config.getActions();
        ((TextView)paramDialog.findViewById(2131165240)).setText(this.config.getAllActionIntro());
        ((EditText)paramDialog.findViewById(2131165239)).setText(str);
        ((TextView)paramDialog.findViewById(2131165242)).setText(this.config.translateActionStr(str));
      }
    case 40:
    }
    Toast.makeText(this, 2131034315, 0).show();
    boolean[] arrayOfBoolean = new boolean[10];
    ArrayList localArrayList = this.proccessor.getDifficultys();
    log("diffs=" + localArrayList);
    Iterator localIterator;
    if ((localArrayList != null) && (localArrayList.size() > 0))
      localIterator = localArrayList.iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        log("checkHistory=" + arrayOfBoolean);
        ((CheckBox)paramDialog.findViewById(2131165263)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165263)).setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(paramDialog, arrayOfBoolean)
        {
          public void onCheckedChanged(CompoundButton paramCompoundButton, boolean paramBoolean)
          {
            AutoBrowActivity.this.log("checked changed");
            CheckBox localCheckBox1 = (CheckBox)this.val$dialog.findViewById(2131165273);
            label34: label66: label99: label232: CheckBox localCheckBox10;
            if (paramBoolean)
            {
              int i = this.val$checkHistory[0];
              localCheckBox1.setChecked(i);
              CheckBox localCheckBox2 = (CheckBox)this.val$dialog.findViewById(2131165264);
              if (!(paramBoolean))
                break label348;
              int k = this.val$checkHistory[1];
              localCheckBox2.setChecked(k);
              CheckBox localCheckBox3 = (CheckBox)this.val$dialog.findViewById(2131165265);
              if (!(paramBoolean))
                break label354;
              int i1 = this.val$checkHistory[2];
              localCheckBox3.setChecked(i1);
              CheckBox localCheckBox4 = (CheckBox)this.val$dialog.findViewById(2131165266);
              if (!(paramBoolean))
                break label360;
              int i3 = this.val$checkHistory[3];
              label132: localCheckBox4.setChecked(i3);
              CheckBox localCheckBox5 = (CheckBox)this.val$dialog.findViewById(2131165267);
              if (!(paramBoolean))
                break label366;
              int i5 = this.val$checkHistory[4];
              label165: localCheckBox5.setChecked(i5);
              CheckBox localCheckBox6 = (CheckBox)this.val$dialog.findViewById(2131165268);
              if (!(paramBoolean))
                break label372;
              int i7 = this.val$checkHistory[5];
              label198: localCheckBox6.setChecked(i7);
              CheckBox localCheckBox7 = (CheckBox)this.val$dialog.findViewById(2131165269);
              if (!(paramBoolean))
                break label378;
              int i9 = this.val$checkHistory[6];
              localCheckBox7.setChecked(i9);
              CheckBox localCheckBox8 = (CheckBox)this.val$dialog.findViewById(2131165270);
              if (!(paramBoolean))
                break label384;
              int i11 = this.val$checkHistory[7];
              label266: localCheckBox8.setChecked(i11);
              CheckBox localCheckBox9 = (CheckBox)this.val$dialog.findViewById(2131165271);
              if (!(paramBoolean))
                break label390;
              int i13 = this.val$checkHistory[8];
              label300: localCheckBox9.setChecked(i13);
              localCheckBox10 = (CheckBox)this.val$dialog.findViewById(2131165272);
              if (!(paramBoolean))
                break label396;
            }
            label348: label354: label360: label366: label372: label378: int i16;
            for (int i15 = this.val$checkHistory[9]; ; i16 = 0)
            {
              localCheckBox10.setChecked(i15);
              return;
              int j = 0;
              break label34:
              int l = 0;
              break label66:
              int i2 = 0;
              break label99:
              int i4 = 0;
              break label132:
              int i6 = 0;
              break label165:
              int i8 = 0;
              break label198:
              int i10 = 0;
              break label232:
              label384: int i12 = 0;
              break label266:
              label390: int i14 = 0;
              label396: break label300:
            }
          }
        });
        ((CheckBox)paramDialog.findViewById(2131165273)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165264)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165265)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165266)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165267)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165268)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165269)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165270)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165271)).setChecked(false);
        ((CheckBox)paramDialog.findViewById(2131165272)).setChecked(false);
      }
      Integer localInteger = (Integer)localIterator.next();
      log("check[i]=true,i=" + localInteger);
      arrayOfBoolean[localInteger.intValue()] = true;
    }
  }

  protected void onResume()
  {
    super.onResume();
    MobclickAgent.onResume(this);
    this.startTime = System.currentTimeMillis();
    App.getApp().getActivitysHolder().regCurrentActivity(this);
  }

  protected void onStart()
  {
    super.onStart();
  }

  private static class SentenceCache
  {
    public boolean isNotifyed2Show = false;
    public int sentence4wordId = -1;
    public String sentenceStr = null;

    public void clear()
    {
      this.sentenceStr = null;
      this.sentence4wordId = -1;
      this.isNotifyed2Show = false;
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.task.done.autobrow.AutoBrowActivity
 * JD-Core Version:    0.5.3
 */